package Java练习.面向对象综合练习.基础;

import java.util.Scanner;

public class CatText {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        //创建数组
        Cat[] arr=new Cat[3];
        //键盘录入加入数组
        for(int i=0;i<=2;i++) {
            //创建汽车对象
            Cat c1=new Cat();
            System.out.print("请输入汽车品牌:");
            String a = sc.next();
            System.out.print("请输入汽车价格:");
            int b = sc.nextInt();
            System.out.print("请输入汽车颜色:");
            String c = sc.next();
            c1.setBrand(a);
            c1.setPrize(b);
            c1.setColour(c);
            //存储到数组
            arr[i]=c1;

        }
        //遍历数组;
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].getBrand()+','+arr[i].getPrize()+','+arr[i].getColour());
        }
    }
}
